import http from '@/utils/request.js'

/** 获取用户个人贷款提交的申请信息 */
export const getApplyInfo = () => http.get('/api/service/loansApplication/getUserLoansStatus')

/** 获取用户企业贷款提交的申请信息 */
export const getApplyEnterprise = () => http.get('/api/service/loansCompanse/getUserLoansStatus')

/** 对应文章接口 */
export const getArticle = (categoryType) =>
  http.get('/api/free/service/articleContent/list', { categoryType })

/** 选项接口 */
export const getSelectData = () => http.get('/api/free/service/loansType/list')

/** 验证黑名单 */
export const checkBlack = () => http.get('/api/free/black/isBlack')

/**
 * 修改申请
 * @param {*} data 提交参数
 * @param {*} type 是否是企业：true 是 false 不是
 * @returns
 */
export const updateApply = (data, type) => {
  return http.put(type ? '/api/service/loansCompanse' : '/api/service/loansApplication', data)
}
